﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using MySql.Data.MySqlClient;
using Cinemon.MySqlConnect;
public partial class License_add : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void TextBox2_TextChanged(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string contactname = ContactNameBox.Text;
        string companyname = companyNameBox.Text;
        string emailadrress = EmailAddressBox.Text;
        string contactNumber = CellphoneNumberBox.Text;
        int number = Int32.Parse(MonthSelectionDrop.SelectedValue);

        using (DatabaseManager manager = new DatabaseManager())
        {
            List<MySqlParameter> param = new List<MySqlParameter> {
				new MySqlParameter("company", companyname),
				new MySqlParameter("contact", contactname),
				new MySqlParameter("email", emailadrress),
				new MySqlParameter("cellphone",contactNumber),
                new MySqlParameter("length", number)
			};
            manager.ExecuteNonQuery("InsertLicense", param);
        }
        Response.Redirect("view.aspx");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("view.aspx");
    }
}